﻿using Message_Management.BLL;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Message_Management.UI.Controllers
{
    public class StudentController : Controller
    {
        /// <summary>
        /// 创建Student_InfoBLL实例
        /// </summary>
        private static Student_InfoBLL bll = new Student_InfoBLL();
        //
        // GET: /Student/
        public ActionResult Index()
        {
            return View();
        }
        /// <summary>
        /// 登录
        /// 一组：杨帆 2018/5/18
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="pwd">密码</param>
        /// <returns></returns>
        [HttpGet]
        public string Login(string userName, string pwd)
        {
            DataTable dt = bll.Login(userName, pwd);
            string result="";
            if (dt.Rows.Count > 0 && dt != null)
            {
                result = JsonConvert.SerializeObject(dt);
            }
            return result;
        }
    }
}